package com.highveldsky.appengine.xmppplay;

import java.io.IOException;
import java.util.Scanner;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@SuppressWarnings("serial")
public class ErrorHandler extends HttpServlet {

	private static final Logger log = Logger.getLogger(ErrorHandler.class.getName());
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		// Log the error
		log.warning("Error stanza received: " + new Scanner(req.getInputStream()).useDelimiter("\\A").next());
		
	}

}
